package com.baitiaojun.video.feign;

import com.baitiaojun.api.domain.user.UserCoin;
import com.baitiaojun.api.domain.user.UserInfo;
import com.baitiaojun.api.exception.ConditionException;
import com.baitiaojun.api.vo.JsonRes;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Set;

/**
 * @类名 UserFeign
 * @描述 TODO
 * @作者 白条君
 * @创建日期 2022/12/25 16:52
 * @版本 1.0
 */
@FeignClient(name = "imooc-bilibili-user", path = "/user")
public interface UserFeign {

    @GetMapping("/user-coin")
    JsonRes getUserCoin(@RequestParam("userId") Long userId);

    @PutMapping("/edit-user-coin")
    JsonRes updateUserCoin(@RequestBody UserCoin userCoin, @RequestParam("token") String token) throws ConditionException;

    @GetMapping("/user-infos")
    List<UserInfo> batchGetUserInfoByUserIdsSet(@RequestParam("userIds") Set<Long> userIds) throws Exception;

    @GetMapping("/person-other-information")
    JsonRes getOtherUserInfo(@RequestParam("id") Long id) throws Exception;
}
